package com.mg.controller;

import com.github.pagehelper.PageInfo;
import com.mg.dto.PurchaseSaleRecordDto;
import com.mg.dto.SimpleResult;
import com.mg.model.PurchaseSaleRecord;
import com.mg.service.PurchaseSaleRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by mg1213 on 2018/3/18.
 */
@Controller
@RequestMapping("/purchaseSaleRecord")
public class PurchaseSaleRecordController {
    @Autowired
    private PurchaseSaleRecordService purchaseSaleRecordService;

    @RequestMapping(value = "/admin/selectPageInfo")
    @ResponseBody
    public PageInfo<PurchaseSaleRecordDto> selectPageInfo(PurchaseSaleRecordDto dto, int limit, int start) {
        return purchaseSaleRecordService.selectPageInfo(dto, start, limit);
    }
    @RequestMapping(value = "/admin/insertPurchaseSaleRecord")
    @ResponseBody
    public SimpleResult insertPurchaseSaleRecord(PurchaseSaleRecord record) {
        return purchaseSaleRecordService.insertPurchaseSaleRecord(record);
    }
    @RequestMapping(value = "/admin/updatePurchaseSaleRecord")
    @ResponseBody
    public SimpleResult updatePurchaseSaleRecord(PurchaseSaleRecord record) {
        return purchaseSaleRecordService.updatePurchaseSaleRecord(record);
    }
    @RequestMapping(value = "/admin/deletePurchaseSaleRecord")
    @ResponseBody
    public SimpleResult deletePurchaseSaleRecord(String ids) {
        return purchaseSaleRecordService.deletePurchaseSaleRecord(ids);
    }

}
